refactor(skill): split the 40 KB monit card into an index plus five surface cards - #158
Merged
Conversation
…urface cards `reference/monit.md` had grown to 40,490 B / 41 verbs spanning five unrelated Flashmonit surfaces, so every monit intent — however narrow — paid for all of them. Partition the generated fence by verb prefix and let SKILL.md's router address each surface directly: monit.md index + preview-sync 1 verb 2,160 B monit-datasource.md datasource CRUD, SLS discovery 7 verbs 5,419 B monit-rule.md rule CRUD, folders, export/import 18 verbs 20,335 B monit-probe.md ad-hoc query, RCA, targets, tools 5 verbs 8,004 B monit-servicemap.md fleet, topology, status 5 verbs 6,026 B monit-ruleset.md store ruleset CRUD 5 verbs 2,635 B The partition is exact — the prefix fences claim all 41 verbs with no double-claim and no dead prefix — so `skilldoc check` stays authoritative and `gen` remains a no-op on a clean tree. Largest card drops 40,490 -> 20,335 B. Intent rows keep their original wording so existing routing still resolves. `monit-probe.md` is reachable through the index rather than from the top-level router: for query and host-diagnostic intents the curated `monit-query` / `monit-agent` cards are the better entry point, and the top-level router already sends those intents there.
…ay which Two leftovers from splitting the monit card. The `monit-query` group description still advertised `diagnose/rows support prometheus|victorialogs|loki|mysql`. `diagnose` never accepted mysql — it pairs `log_patterns` with loki/victorialogs and `metric_trends` with prometheus — and `rows` has been deprecated and hidden since `data` replaced it, so the group blurb was pointing at a command the help output no longer lists. The bigger one: this product uses "datasource" for two unrelated things. `POST /monit/datasource/*` is the Flashmonit config surface — the systems Flashmonit queries. `POST /datasource/*` is On-call, holding IM-integration plumbing, and On-call's *integrations* — what actually receives alerts into a channel — are a third surface again. Giving datasources their own card made this worse, because the router now hands the bare word "数据源 / datasource" straight to Flashmonit, and an On-call integration question matches that row. So the card says which one it is, in the first paragraph a reader sees, and names where the other two live. The router row is qualified the same way, and the channel row picks up 告警来源 so the On-call sense has a keyword of its own. The index card carries a one-line version for readers who land there first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #157 — base is
fix/monit-query-diagnose-dstype, so this PR's diff shows only the split. GitHub retargets it tomainautomatically once #157 merges. Merge #157 first.Why
reference/monit.mdwas 40,490 B / 41 verbs. Themonitcommand group is not one surface — it is five (datasources, alert rules, probing, service map, store rulesets) that happen to share a CLI prefix. A skill that only needsdatasource-listwas loading rule export, service-map topology and the on-box tools catalog along with it, and the card is loaded whole or not at all.What
Partition the generated fence by verb prefix; the router in
SKILL.mdnow addresses each surface directly instead of pointing every monit intent at one card.monit.mdpreview-syncmonit-datasource.mdmonit-rule.mdmonit-probe.mdmonit-servicemap.mdmonit-ruleset.mdLargest card: 40,490 → 20,335 B. Typical monit intent now loads one card of a few KB instead of 40 KB.
preview-syncbelongs to no surface (it previews a datasource query before a rule saves it), so it stays on the index card rather than getting a card of its own.The partition is exact
The prefix fences claim all 41 verbs with no double-claim and no dead prefix, so
skilldoc checkremains authoritative — a new verb still has to land in exactly one card or CI fails. This is the same prefix-fence mechanism already used by three other cards, so it is mechanical, not a new pattern.monit-probe.mddeliberately has no top-level router row. For query and host-diagnostic intents the curatedmonit-query/monit-agentcards are the better entry point and the router already sends those intents there; the raw verbs stay reachable one hop down through the index.Verified
go run ./internal/cmd/skilldoc check→skilldoc: cards OKgo run ./internal/cmd/skilldoc gen→ no diff on a clean treego build ./...clean;go test ./...→ 0 FAIL